Skip to content

Comments

Refactor dict merging using ChainMap#11

Open
StrideZhou wants to merge 2 commits intoflorianmahner:mainfrom
StrideZhou:patch-1
Open

Refactor dict merging using ChainMap#11
StrideZhou wants to merge 2 commits intoflorianmahner:mainfrom
StrideZhou:patch-1

Conversation

@StrideZhou
Copy link

Replaced dictionary unpacking ({**dict1, **dict2}) with collections.ChainMap for merging dicts. This change affects the _extract_base_defaults and add_arguments_from_toml methods, improving performance and preserving original data structures. It also allows more flexible handling of configuration overrides and inheritance.

Replaced dictionary unpacking ({**dict1, **dict2}) with collections.ChainMap for merging dicts. This change affects the _extract_base_defaults and add_arguments_from_toml methods, improving performance and preserving original data structures. It also allows more flexible handling of configuration overrides and inheritance.
@codecov
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (a894698) to head (3943291).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files           2        2           
  Lines          80       81    +1     
  Branches       13       13           
=======================================
+ Hits           80       81    +1     
Flag Coverage Δ
unittests 100.0% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@florianmahner
Copy link
Owner

thank you - this indeed looks like a good contribution. some type checks are still failing (eg also returning ChainMap as type). could you make these adjustments? then i am happy to merge once the checks are passing

fix return type error:
dict[str, Any] -> ChainMap[str, Any]
@florianmahner
Copy link
Owner

please see Contributing.md to check how you can test in advance. Happy to accept once tests pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants